#include "gdn/SoundManager.h"

namespace gdn
{
	SoundManager::SoundManager()
	{
		Manager< SoundBuffer >();
	}

	SoundManager::~SoundManager()
	{
		UnloadAll();
	}

	void SoundManager::Load( const std::string& resName )
	{
		Manager< SoundBuffer >::Load( resName );
	}

	bool SoundManager::IsLoaded( const std::string& resName )
	{
		return Manager< SoundBuffer >::IsLoaded( resName );
	}

	void SoundManager::Unload( const std::string& resName )
	{
		Manager< SoundBuffer >::Unload( resName );
	}

	void SoundManager::LoadAll()
	{
		Manager< SoundBuffer >::LoadAll();
	}

	void SoundManager::UnloadAll()
	{
		Manager< SoundBuffer >::UnloadAll();
	}

	void SoundManager::AddResource( const std::string& resName, SoundBuffer* resource )
	{
		Manager< SoundBuffer >::AddResource( resName, resource );
	}

	Sound SoundManager::GetResource( const std::string& resName )
	{
		Sound sound;
		sound.SetSoundBuffer( ( * Manager< SoundBuffer >::GetResource( resName ) ) );
		return sound;
	}

	void SoundManager::RemoveResource( const std::string& resName )
	{
		Manager< SoundBuffer >::RemoveResource( resName );
	}

	bool SoundManager::DoesResourceExist( const std::string& resName )
	{
		return Manager< SoundBuffer >::DoesResourceExist( resName );
	}
}
